// 目标：统一管理接口地址
import request from './request'
import qs from 'qs'

// 短信验证码
export const SendSMSAPI = (phone) => request.post('/sendSMS', qs.stringify({ phone }))
// 手机号验证码登录
export const PhoneReginAPI = (verifyCode, phone) => request.post('/phoneRegin', qs.stringify({ verifyCode, phone }))
// 微信扫码登录
export const WXLoginAPI = (code) => request.post('/wechatUsers/PCLogin', qs.stringify({ code }))
// 手机关联微信请求
export const BindWXAPI = (params) => request.post('/wechatUsers/binding', qs.stringify(params))
// 获取用户信息
export const UserProfilesAPI = () => request.get('/shop/userProfiles')
// 精品推荐
export const JinpingAPI = () => request.get('/products/recommend')
// 热门兑换
export const RemenAPI = () => request.get('/products/hot')
// 商品详情(根据id)
export const GoodsDetailsAPI = (id) => request.get(`/products/${id}`)
// 加入到购物车
export const AddToCartAPI = (params) => request.post('/shop/carts/add', qs.stringify(params))
// 请求全部商品,商品搜索（含首页的“更多”）
export const GoodsSearchAPI = (params) => request.get('/products', { params })
// 查看购物车
export const CartsAPI = () => request.get('/shop/carts')
// 购物车删除商品
export const CartsDelAPI = (id) => request.delete(`/shop/carts?productIds=${id}`)
